$(document).ready(function(){
	$("body").append("<style>" +
			"#zdTitle{" +
			"border-top:1px solid #D0ECFB;" +
			"border-bottom:1px solid #D0ECFB;" +
			"width:233px;" +
			"height:20px;" +
			"font-weight:800;" +
			"padding:5px 5px;" +
			"padding-left:10px;" +
			"font-size:13px;" +
				"background-color:#F1FCCF;" +
			"clear:both;" +
			"" +
			"" +
			"}" +
			"#zdContent{" +
			"padding:10px 10px;" +
			"background-color:white;" +
			"line-height:120%;" +
			"" +
			"}" +
			"#zdTips{" +
			"display:none;" +
			"-webkit-box-shadow:2px 2px 2px black;" +
			"-moz-box-shadow:2px 2px 2px black;" +
			"" +
			"" +
			"position:absolute;" +
			"font-size:12px;" +
			"width:250px;" +
			"height:auto;" +
			"border-bottom:2px solid #CCCCCC;" +
			"border-right:2px solid #CCCCCC;" +
			"}" +
			"</style>");
	$("body").append("<div id='zdTips'><div style='border:1px solid #CCCCCC;'>" +
			"<div id='zdTitle'>" +
			"<div style='float:left;width:100px;height:15px;line-height:18px;'>帮助说明</div> " +
			"</div>" +
			"<div id='zdContent'>ddddddddd</div>" +
			"</div></div>");
	
	
	$("th").each(function(){
		if($(this).attr("fullcontent")!=undefined)
		{
			$(this).append("&nbsp;<img src='/images/tips.gif' onmouseout='hidezdTips()' onmouseover='showzdTips(\""+$(this).attr("fullcontent")+"\",event)'/>");
		}		
	});
	
	$("td").each(function(){
		if($(this).attr("fullcontent")!=undefined)
		{
			$(this).append("&nbsp;<img src='/images/tips.gif' onmouseout='hidezdTips()' onmouseover='showzdTips(\""+$(this).attr("fullcontent")+"\",event)'/>");
		}		
	});
});

function hidezdTips(){
	$("#zdTips").hide();
}

function showzdTips(content,e){
	var str=''
	
	var aobj=document.getElementById("zdTips");
	var i=0;
	for(var obj in aobj)
	{
		i++;
		if(i%5==0)
			str+=obj+":"+e[obj]+"\n";
		else
			str+=obj+":"+e[obj];
	}
	
	if(e.clientX > $(window).width()/2)
		$("#zdTips").css({"top":e.clientY+$(window).scrollTop()-$("#zdTips").height()-12,"left":e.clientX+$(window).scrollLeft()-250});
	else
		$("#zdTips").css({"top":e.clientY+$(window).scrollTop()-$("#zdTips").height()-12,"left":e.clientX+$(window).scrollLeft()});
	
	
	$("#zdContent").html(content);
	$("#zdTips").show();
}